<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('订单类别')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="cyq:order:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="cyq:order:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="cyq:order:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('cyq:order:edit')}]];
    var removeFlag = [[${@permission.hasPermi('cyq:order:remove')}]];
    var prefix = ctx + "cyq/order/genre";



    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            detailUrl: prefix + "/detail/{id}",
            exportUrl: prefix + "/export",
            sortName: "genreId",
            modalName: "订单分类",
            columns: [{
                checkbox: true
            },
                {
                    field: 'genreId',
                    title: '订单类别id'
                },
                {
                    field: 'genreName',
                    title: '类别名称',
                    sortable: true
                },
                {
                    field: 'genreRemark',
                    title: '类别备注',
                    sortable: true
                },
                {
                    field: 'genreAmount',
                    title: '订单数量',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs" href="#" onclick="$.operate.detail(\'' + row.genreId + '\')"><i class="fa fa-search"></i>点击查看详细</a> ');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });


</script>
</body>
</html>